package com.duapk.web.util;

import org.jasypt.util.text.BasicTextEncryptor;

public class EncryptorUtils {
	
	private static final String PASSWD = "a";

	private static BasicTextEncryptor encryptor = new BasicTextEncryptor();

	static {
		encryptor.setPassword(PASSWD);
	}

	/**
	 * 
	 * @return
	 */
	public static String getEncryptionString(String message) {
		return encryptor.encrypt(message);
	}

	public static String getDecryptionString(String encryptedMessage) {
		return encryptor.decrypt(encryptedMessage);
	}

	public static void main(String[] args) {
		String result = getEncryptionString("39koawekrodkfe");
		String passwd = getDecryptionString(result);
		System.out.println(result);
		System.out.println(passwd);
	}

}
